#include <iostream>
using namespace std;
class container {
public:
    virtual double surface_area() = 0;
    virtual double volume() = 0;
};
class cube : public container {
public:
    double side;
    cube(double s) : side(s) {}
    double surface_area() override {
        return 6 * side * side;
    }
    double volume() override {
        return side * side * side;
    }
};
class sphere : public container {
public:
    double Radius;
    sphere(double R) : Radius(R) {}
    double surface_area() override {
        return 4 * 3.141592653589793 * Radius * Radius;
    }
    double volume() override {
        return (4.0 / 3.0) * 3.141592653589793 * Radius * Radius * Radius;
    }
};
class cylinder : public container {
public:
    double radius, height;
    cylinder(double r, double h) : radius(r), height(h) {}
    double surface_area() override {
        return 2 * 3.141592653589793 * radius * radius + 2 * 3.141592653589793 * radius * height;
    }
    double volume() override {
        return 3.141592653589793 * radius * radius * height;
    }
};
int main() {
    double b, R, r, h;
    cout << "输入正方体边长:" << endl;
    cin >> b;
    cout << "输入球体半径:" << endl;
    cin >> R;
    cout << "输入圆柱体半径和高度:" << endl;
    cin >> r >> h;
    cube A(b);
    sphere B(R);
    cylinder C(r, h);
    cout << "cube area:" << A.surface_area() << endl;
    cout << "cube volume:" << A.volume() << endl;
    cout << "sphere area:" << B.surface_area() << endl;
    cout << "sphere volume:" << B.volume() << endl;
    cout << "cylinder area:" << C.surface_area() << endl;
    cout << "cylinder volume:" << C.volume() << endl;
    return 0;
}